package com.hdax.dm.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hdax.dm.entity.order.DmOrderLinkUser;
import com.hdax.dm.mappers.OrderLinkUserMapper;
import com.hdax.dm.service.OrderLinkUserService;
import com.mysql.cj.xdevapi.SchemaImpl;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Service
public class OrderLinkUserSImpl extends ServiceImpl<OrderLinkUserMapper,DmOrderLinkUser> implements OrderLinkUserService {

    @Override
    public Integer oderLinkUserAdd(DmOrderLinkUser orderLinkUser) {
        orderLinkUser.setCreatedTime(LocalDateTime.now());
        return baseMapper.insert(orderLinkUser);
    }

    @Override
    public Integer orderLinkUserDel(String orderNo) {
        QueryWrapper<DmOrderLinkUser> wrapper=new QueryWrapper<>();
        wrapper.eq("orderId",orderNo);
        return baseMapper.delete(wrapper);
    }
}
